<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" exclude-result-prefixes="fo">
<xsl:output method="xml" version="1.0" omit-xml-declaration="no" indent="yes"/>

<!-- ========================= -->
<!-- root element: creditNoteAcknowledgement -->
<!-- ========================= -->


<xsl:template match="creditNoteAcknowledgement">

	<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">

	<fo:layout-master-set>
		<fo:simple-page-master master-name="simpleA4"
        		page-height="11in"
        		page-width="8.5in"
        		margin-top="20mm"
        		margin-bottom="20mm"
      			margin-left="7mm"
      			margin-right="10mm" >

			<fo:region-after extent="3mm"/>

			<fo:region-body />

  		</fo:simple-page-master>
        <fo:simple-page-master master-name="termsAndConditionsMasterName"
        		page-height="9in"
        		page-width="11.69in"
        		margin-top="5mm"
        		margin-bottom="0.30in"
      			margin-left="7mm"
      			margin-right="10mm" >
            <fo:region-before extent="0mm"/>
			<fo:region-after extent="3mm"/>
			<fo:region-body margin-top="0mm" margin-bottom="0.65in"/>
  		</fo:simple-page-master>
    </fo:layout-master-set>
<fo:page-sequence master-reference="simpleA4">
<!--============================== -->
<!-- Page Number block             -->
<!-- Modified By Basha (12/24/2003)-->
<!--============================== -->
<fo:static-content flow-name="xsl-region-after">
	<fo:block font-size="7pt" font-weight="bold" text-align="right">
            Page <fo:page-number />
	     of
	    <fo:page-number-citation ref-id="endofdoc"/>
    </fo:block>
</fo:static-content>

<fo:flow flow-name="xsl-region-body">
<!--==============================-->
<!-- Logo and Self address block  -->
<!--==============================-->
	<fo:block font-size="8pt" space-after="1cm">
	<fo:table table-layout="fixed" width="100%" >

	<fo:table-column column-width="10mm" />
	<fo:table-column column-width="35mm"/>
	<fo:table-column column-width="20mm" />
	<fo:table-column display-align="center" />
	<fo:table-column />

	<fo:table-body>
		<fo:table-row>
			<fo:table-cell />

			<fo:table-cell>
			<xsl:apply-template match="logo">
				<fo:external-graphic content-height = ".5in"  content-width = ".5in" >
					<xsl:attribute name="src" >
						<xsl:value-of select="logo" />
					</xsl:attribute>
				</fo:external-graphic>
			</xsl:apply-template>
		     	</fo:table-cell>

			<fo:table-cell />

		     	<fo:table-cell text-align="center" width="100%">
                    <fo:block font-size="12pt" font-weight="bold"><xsl:value-of select="heading"/></fo:block>
                    <xsl:apply-template match="selfAddress">
                        <fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="selfAddress//name" /></fo:block>
                        <fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="selfAddress//address1" /></fo:block>
                        <fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="selfAddress//address2" /></fo:block>
                        <fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="selfAddress//address3" /></fo:block>
                        <fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="selfAddress//address4" /></fo:block>
                        <fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="selfAddress//cityStateZip" /></fo:block>
                        <fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="selfAddress//phoneFax" /></fo:block>
			  	    </xsl:apply-template>
		     	</fo:table-cell>
			<fo:table-cell />
		</fo:table-row>
	</fo:table-body>
	</fo:table >
	</fo:block>

	<fo:table table-layout="fixed" width="102%" space-after="0.5cm" >
        <fo:table-column column-width="64mm"/>
		<fo:table-column column-width="2mm" />
		<fo:table-column column-width="64mm" />


		<fo:table-body>
			<fo:table-row>
                <fo:table-cell hyphenate="true" language="en" >
			 		<fo:block font-size="8pt" > <xsl:apply-templates select="billToAddress"/> </fo:block>
				</fo:table-cell>

				<fo:table-cell/>

				<fo:table-cell hyphenate="true" language="en" >
			 		<fo:block font-size="8pt" > <xsl:apply-templates select="shipToAddress"/> </fo:block>
				</fo:table-cell>
                
            </fo:table-row>
		</fo:table-body>
	</fo:table>

    <!--===============================-->
        <!-- Information block             -->
    <!--===============================-->

    <fo:block font-size="8pt" space-after="0.5cm">
        <xsl:apply-templates select="information"/>
    </fo:block>

<!--=============================== -->
<!-- Comments Instructions block    -->
<!--=============================== -->

	<fo:block font-size="8pt" font-weight="bold" space-after="0.5mm" >Comments:</fo:block>
        <fo:block font-size="8pt" background-color="#FFFFEE" space-after="0.5cm" > <xsl:value-of select="comments"/> </fo:block>

<!--=============================== -->
<!-- Line Items details block      -->
<!--=============================== -->
<!--
    <fo:block font-size="8pt" space-after="0.5cm">
	        <xsl:apply-templates select="cenceledLineItems"/>
    </fo:block>
    <fo:block font-weight="bold" text-align="left" font-size="8pt" space-after="0.5cm">
        <xsl:value-of select="/creditNoteAcknowledgement/cenceledLineItemsNotPresentMessage"/>
    </fo:block>
-->

	<fo:block font-size="8pt" space-after="0.5cm">
	        <xsl:apply-templates select="lineItems"/>
    </fo:block>
    <fo:block font-weight="bold" text-align="left" font-size="8pt" space-after="0.5cm">
        <xsl:value-of select="/creditNoteAcknowledgement/lineItemsNotPresentMessage"/>
    </fo:block>

    <fo:table table-layout="note" width="102%" space-after="1cm">
        <fo:table-column  column-width="100mm"/>
        <fo:table-body>
            <fo:table-row>
                <fo:table-cell>
                    <fo:block font-size="7pt" > <xsl:apply-templates select="notes"/> </fo:block>
                </fo:table-cell>
            </fo:table-row>
        </fo:table-body>
    </fo:table>

<fo:block id="endofdoc"></fo:block>
</fo:flow>
</fo:page-sequence>
<fo:page-sequence master-reference="termsAndConditionsMasterName">
    <fo:flow flow-name="xsl-region-body">
        <fo:block><div style="page-break-before: always"/></fo:block>
        <fo:block font-size="8pt" space-after="2cm">
            <fo:table margin="2mm" table-layout="fixed"  width="100%">
            <fo:table-column  column-width="285mm"/>
                <fo:table-body>
                    <fo:table-row>
                        <fo:table-cell>
                            <xsl:apply-template match="termsPage1">
                            <fo:external-graphic width="70cm" height="50cm" content-width="70cm" content-height="50cm" display-align="center" text-align="center">
                                <xsl:attribute name="src">
                                    <xsl:value-of select="termsPage1"/>
                                </xsl:attribute>
                            </fo:external-graphic>
                            </xsl:apply-template>
                        </fo:table-cell>
                    </fo:table-row>
                </fo:table-body>
            </fo:table>
        </fo:block>
    </fo:flow>
</fo:page-sequence>

</fo:root>
</xsl:template>



<!-- ================================ -->
<!--	child element: Self Address     -->
<!-- ================================ -->

<xsl:template match="selfAddress">
	<fo:table width="100%" table-layout="fixed">
	<fo:table-column />
		<fo:table-body>
			<fo:table-row>
				<fo:table-cell text-align="center">
					<fo:block font-weight="bold">Self Address:</fo:block>
					<fo:block><xsl:value-of select="name"/></fo:block>
					<fo:block><xsl:value-of select="address1"/></fo:block>
					<fo:block><xsl:value-of select="address2"/></fo:block>
					<fo:block><xsl:value-of select="address3"/></fo:block>
					<fo:block><xsl:value-of select="phone"/></fo:block>
					<fo:block><xsl:value-of select="fax"/></fo:block>
					<fo:block>Email: <xsl:value-of select="email"/></fo:block>

				</fo:table-cell>
			</fo:table-row>
		</fo:table-body>
	</fo:table>
</xsl:template>

<!-- ================================ -->
<!--  Child element: Bill To Address  -->
<!-- ================================ -->

<xsl:template match="billToAddress">
	<fo:table margin="2mm" width="100%" table-layout="fixed">
		<fo:table-column />
	        <fo:table-body>
			<fo:table-row height="0.5cm">
				<fo:table-cell background-color="#DEE1E2" border="1pt double black" display-align="center">
				<fo:block font-weight="bold">Billing Address :</fo:block>
				</fo:table-cell>
			</fo:table-row>

			<fo:table-row height="4cm">
				<fo:table-cell font-weight="bold" background-color="#FFFFEE" border="1pt double black" display-align="top">

                    <fo:block><xsl:value-of select="address1"/></fo:block>
                    <fo:block><xsl:value-of select="contactPerson"/></fo:block>
                    <fo:block><xsl:value-of select="address2"/></fo:block>
                    <fo:block><xsl:value-of select="address3"/></fo:block>
                    <fo:block><xsl:value-of select="address4"/></fo:block>
                    <fo:block><xsl:value-of select="city"/></fo:block>
                    <fo:block><xsl:value-of select="stateZipCountry"/></fo:block>
                    <fo:block><xsl:value-of select="phone"/></fo:block>
                    <fo:block><xsl:value-of select="cell"/></fo:block>
                    <fo:block><xsl:value-of select="fax"/></fo:block>
                    <fo:block><xsl:value-of select="email"/></fo:block>

				</fo:table-cell>
			</fo:table-row>

		</fo:table-body>
	</fo:table>
</xsl:template>

<!-- =================================== -->
<!--	Child element: Ship To Address   -->
<!-- =================================== -->

<xsl:template match="shipToAddress">
	<fo:table margin="2mm" width="100%" table-layout="fixed">
		<fo:table-column />
	        <fo:table-body>
			<fo:table-row height="0.5cm">
				<fo:table-cell background-color="#DEE1E2" border="1pt double black" display-align="center">
				<fo:block font-weight="bold">Shiping Address :</fo:block>
				</fo:table-cell>
			</fo:table-row>

			<fo:table-row height="4cm">
				<fo:table-cell font-weight="bold" background-color="#FFFFEE" border="1pt double black" display-align="top">

                    <!--<fo:block><xsl:value-of select="name"/></fo:block>-->
                    <fo:block><xsl:value-of select="address1"/></fo:block>
                    <fo:block><xsl:value-of select="contactPerson"/></fo:block>
                    <fo:block><xsl:value-of select="address2"/></fo:block>
                    <fo:block><xsl:value-of select="address3"/></fo:block>
                    <fo:block><xsl:value-of select="address4"/></fo:block>
                    <fo:block><xsl:value-of select="city"/></fo:block>
                    <fo:block><xsl:value-of select="stateZipCountry"/></fo:block>
                    <fo:block><xsl:value-of select="phone"/></fo:block>
                    <fo:block><xsl:value-of select="cell"/></fo:block>
                    <fo:block><xsl:value-of select="fax"/></fo:block>
                    <fo:block><xsl:value-of select="email"/></fo:block>

				</fo:table-cell>
			</fo:table-row>

		</fo:table-body>
	</fo:table>
</xsl:template>


<!-- =================================== -->
<!--	child element: Information       -->
<!-- =================================== -->


<xsl:template match="information">
	<fo:block font-size="7pt">
	<fo:table table-layout="fixed" width="102%" >
        <fo:table-column column-width="100mm"/>
        <fo:table-column column-width="3mm" />
        <fo:table-column column-width="100mm" />

        <fo:table-body>
			<fo:table-row height="0.5cm" >
                <fo:table-cell display-align="top" width="100%">
		    	    <fo:table width="100%" table-layout="fixed">
                        <fo:table-column column-width="25mm"/>
                        <fo:table-column column-width="25mm"/>
                        <fo:table-column column-width="25mm"/>
                        <fo:table-column column-width="25mm"/>
                        <fo:table-body>
					        <fo:table-row height="0.5cm" background-color="#DEE1E2">
                                <fo:table-cell border="1pt double black" display-align="center">
                                    <fo:block font-weight="bold" text-align="left"><xsl:value-of select="noteType"/> Note #</fo:block>
                                </fo:table-cell>
                                <fo:table-cell border="1pt double black" display-align="center">
                                    <fo:block font-weight="bold" text-align="left">Sales Order #</fo:block>
                                </fo:table-cell>
                                <fo:table-cell border="1pt double black" display-align="center">
                                    <fo:block font-weight="bold" text-align="left">Date Issued</fo:block>
                                </fo:table-cell>
                                <fo:table-cell border="1pt double black" display-align="center">
                                    <fo:block font-weight="bold" text-align="left">Customer PO #</fo:block>
                                </fo:table-cell>
                            </fo:table-row>
                            <fo:table-row height="0.5cm" background-color="#FFFFEE">
                                <fo:table-cell border="1pt double black" display-align="center">
                                    <fo:block font-weight="bold" text-align="left">
                                        <xsl:value-of select="creditNoteNo"/>
                                    </fo:block>
                                </fo:table-cell>
                                <fo:table-cell border="1pt double black" display-align="center">
                                    <fo:block font-weight="bold" text-align="left">
                                        <xsl:value-of select="salesOrderNo"/>
                                    </fo:block>
                                </fo:table-cell>
                                <fo:table-cell border="1pt double black" display-align="center">
                                    <fo:block font-weight="bold" text-align="left">
                                        <xsl:value-of select="dateIssued"/>
                                    </fo:block>
                                </fo:table-cell>
                                <fo:table-cell border="1pt double black" display-align="center">
                                    <fo:block font-weight="bold" text-align="left">
                                        <xsl:value-of select="customerPO"/>
                                    </fo:block>
                                </fo:table-cell>
                            </fo:table-row>
                        </fo:table-body>
                    </fo:table>
                </fo:table-cell>
                <fo:table-cell/>
                <fo:table-cell display-align="top" width="100%">
		    	    <fo:table width="100%" table-layout="fixed">
                        <fo:table-column column-width="20mm"/>
                        <fo:table-column column-width="20mm"/>
                        <fo:table-column column-width="20mm"/>
                        <fo:table-column column-width="20mm"/>
                        <fo:table-column column-width="20mm"/>
                        <fo:table-body>
					        <fo:table-row height="0.5cm" background-color="#DEE1E2">
                                <fo:table-cell border="1pt double black" display-align="center">
                                    <fo:block font-weight="bold" text-align="left">Customer</fo:block>
                                </fo:table-cell>
                                <fo:table-cell border="1pt double black" display-align="center">
                                    <fo:block font-weight="bold" text-align="left">End Customer</fo:block>
                                </fo:table-cell>
                                <fo:table-cell border="1pt double black" display-align="center">
                                    <fo:block font-weight="bold" text-align="left">End User</fo:block>
                                </fo:table-cell>
                                <fo:table-cell border="1pt double black" display-align="center">
                                    <fo:block font-weight="bold" text-align="left">Sales Rep</fo:block>
                                </fo:table-cell>
                                <fo:table-cell border="1pt double black" display-align="center">
                                    <fo:block font-weight="bold" text-align="left">Pay Terms</fo:block>
                                </fo:table-cell>
                            </fo:table-row>
                            <fo:table-row height="0.5cm" background-color="#FFFFEE">
                                <fo:table-cell border="1pt double black" display-align="center">
                                    <fo:block font-weight="bold" text-align="left">
                                        <xsl:value-of select="customer"/>
                                    </fo:block>
                                </fo:table-cell>
                                <fo:table-cell border="1pt double black" display-align="center">
                                    <fo:block font-weight="bold" text-align="left">
                                        <xsl:value-of select="endCustomer"/>
                                    </fo:block>
                                </fo:table-cell>
                                <fo:table-cell border="1pt double black" display-align="center">
                                    <fo:block font-weight="bold" text-align="left">
                                        <xsl:value-of select="endUser"/>
                                    </fo:block>
                                </fo:table-cell>
                                <fo:table-cell border="1pt double black" display-align="center">
                                    <fo:block font-weight="bold" text-align="left">
                                        <xsl:value-of select="salesRep"/>
                                    </fo:block>
                                </fo:table-cell>
                                <fo:table-cell border="1pt double black" display-align="center">
                                    <fo:block font-weight="bold" text-align="left">
                                        <xsl:value-of select="payTerms"/>
                                    </fo:block>
                                </fo:table-cell>
                            </fo:table-row>
                        </fo:table-body>
                    </fo:table>
                </fo:table-cell>
            </fo:table-row>

            <fo:table-row height="2mm" ></fo:table-row>

            <fo:table-row height="0.5cm" >
                <fo:table-cell display-align="top" width="100%">
		    	    <fo:table width="100%" table-layout="fixed">
                        <fo:table-column column-width="25mm"/>
                        <fo:table-column column-width="25mm"/>
                        <fo:table-body>
					        <fo:table-row height="0.5cm" background-color="#DEE1E2">
                                <fo:table-cell border="1pt double black" display-align="center">
                                    <fo:block font-weight="bold" text-align="left">Packing Slip Label</fo:block>
                                </fo:table-cell>
                                <fo:table-cell border="1pt double black" display-align="center">
                                    <fo:block font-weight="bold" text-align="left">Is Consider Units</fo:block>
                                </fo:table-cell>
                            </fo:table-row>
                            <fo:table-row height="0.5cm" background-color="#FFFFEE">
                                <fo:table-cell border="1pt double black" display-align="center">
                                    <fo:block font-weight="bold" text-align="left"><xsl:value-of select="packingSlipLabel"/></fo:block>
                                </fo:table-cell>
                                <fo:table-cell border="1pt double black" display-align="center">
                                    <fo:block font-weight="bold" text-align="left"><xsl:value-of select="isConsiderUnits"/></fo:block>
                                </fo:table-cell>
                            </fo:table-row>
                        </fo:table-body>
                    </fo:table>
                </fo:table-cell>
                <fo:table-cell/>
                <fo:table-cell/>
            </fo:table-row>

        </fo:table-body>
	</fo:table>
</fo:block>
</xsl:template>

    <!-- =================================== -->
    <!--	child element: LineItems. 	     -->
    <!-- =================================== -->

<xsl:template match="lineItems">
	<fo:block font-size="7pt">
        <fo:table margin="2mm" width="100%" table-layout="fixed">
		    <fo:table-column column-width="7mm"/>
	        <fo:table-column column-width="7mm"/>
		    <fo:table-column column-width="22mm"/>
	        <fo:table-column column-width="20mm"/>
 		    <fo:table-column column-width="23mm"/>
	        <fo:table-column column-width="11mm"/>
	        <fo:table-column column-width="13mm"/>
	        <fo:table-column column-width="12mm"/>
		    <fo:table-column column-width="17mm"/>
	        <fo:table-column column-width="21mm"/>
		    <fo:table-column column-width="15mm"/>
            <fo:table-column column-width="15mm"/>
            <fo:table-column column-width="20mm"/>
            <fo:table-body>
			<fo:table-row height="0.6cm" background-color="#DEE1E2">
				<fo:table-cell border="1pt double black" display-align="center" >
			    		<fo:block font-weight="bold" text-align="center">Line Item #</fo:block>
	  			</fo:table-cell>
	  			<fo:table-cell border="1pt double black" display-align="center" >
		    			<fo:block font-weight="bold" text-align="center">PO Line Item #</fo:block>
	  			</fo:table-cell>
	  			<fo:table-cell border="1pt double black" display-align="center" >
		    			<fo:block font-weight="bold" text-align="center"><xsl:value-of select="labelMfgPartNumber"/></fo:block>
	  			</fo:table-cell>
	  			<fo:table-cell border="1pt double black" display-align="center" >
		    			<fo:block font-weight="bold" text-align="center"><xsl:value-of select="labelCustPartNumber"/></fo:block>
	  			</fo:table-cell>
                <fo:table-cell border="1pt double black" display-align="center" >
		    			<fo:block font-weight="bold" text-align="center">Description</fo:block>
	  			</fo:table-cell>
	  			<fo:table-cell border="1pt double black" display-align="center" >
		    			<fo:block font-weight="bold" text-align="center">Shipped Qty</fo:block>
	  			</fo:table-cell>
	  			<fo:table-cell border="1pt double black" display-align="center" >
					<fo:block font-weight="bold" text-align="center">Ship Date</fo:block>
				</fo:table-cell>
				<fo:table-cell border="1pt double black" display-align="center" >
					<fo:block font-weight="bold" text-align="center">Unit Price</fo:block>
				</fo:table-cell>
				<fo:table-cell border="1pt double black" display-align="center">
					<fo:block font-weight="bold" text-align="center">Amount</fo:block>
				</fo:table-cell>
       			<fo:table-cell border="1pt double black" display-align="center">
					<fo:block font-weight="bold" text-align="center">Reason</fo:block>
				</fo:table-cell>
                <fo:table-cell border="1pt double black" display-align="center">
                    <fo:block font-weight="bold" text-align="center">Change To Qty</fo:block>
                </fo:table-cell>
                <fo:table-cell border="1pt double black" display-align="center">
                    <fo:block font-weight="bold" text-align="center">Change To Price</fo:block>
                </fo:table-cell>
       			<fo:table-cell border="1pt double black" display-align="center">
					<fo:block font-weight="bold" text-align="center">Change To Amount</fo:block>
				</fo:table-cell>
			</fo:table-row>
            <xsl:for-each select="lineItem">
                <fo:table-row height="0.4cm" background-color="#FFFFEE">
                    <fo:table-cell border="1pt double black" display-align="center">
                        <fo:block font-weight="bold" text-align="center">
                        <xsl:value-of select="crLineItem"/>
                        </fo:block>
                    </fo:table-cell>
                    <fo:table-cell border="1pt double black" display-align="center">
                        <fo:block font-weight="bold" text-align="center">
                        <xsl:value-of select="poLineItem"/>
                        </fo:block>
                    </fo:table-cell>
                    <fo:table-cell border="1pt double black" display-align="center" hyphenate="true" language="en">
                        <fo:block font-weight="bold" text-align="left">
                        <xsl:value-of select="mfgPartNumber"/>
                        </fo:block>
                    </fo:table-cell>
                    <fo:table-cell border="1pt double black" display-align="center" hyphenate="true" language="en">
                        <fo:block font-weight="bold" text-align="left">
                        <xsl:value-of select="customerPartNumber"/>
                        </fo:block>
                    </fo:table-cell>
                    <fo:table-cell border="1pt double black" display-align="center" hyphenate="true" language="en">
                        <fo:block font-weight="bold" text-align="left">
                        <xsl:value-of select="description"/>
                        </fo:block>
                    </fo:table-cell>

                    <fo:table-cell border="1pt double black" display-align="center">
                        <fo:block font-weight="bold" text-align="center">
                        <xsl:value-of select="shipedQty"/>
                        </fo:block>
                    </fo:table-cell>
                    <fo:table-cell border="1pt double black" display-align="center">
                        <fo:block font-weight="bold" text-align="center">
                        <xsl:value-of select="shipDate"/>
                        </fo:block>
                    </fo:table-cell>
                    <fo:table-cell border="1pt double black" display-align="center" hyphenate="true" language="en">
                        <fo:block font-weight="bold" text-align="right">
                        <xsl:value-of select="unitPrice"/>
                        </fo:block>
                    </fo:table-cell>
                    <fo:table-cell border="1pt double black" display-align="center" hyphenate="true" language="en">
                        <fo:block font-weight="bold" text-align="right">
                        <xsl:value-of select="amount"/>
                        </fo:block>
                    </fo:table-cell>

                    <fo:table-cell border="1pt double black" display-align="center">
                        <fo:block font-weight="bold" text-align="left">
                        <xsl:value-of select="reason"/>
                        </fo:block>
                    </fo:table-cell>
                    <fo:table-cell border="1pt double black" display-align="center" hyphenate="true" language="en">
                        <fo:block font-weight="bold" text-align="right">
                        <xsl:value-of select="adjustmentQty"/>
                        </fo:block>
                    </fo:table-cell>
                    <fo:table-cell border="1pt double black" display-align="center" hyphenate="true" language="en">
                        <fo:block font-weight="bold" text-align="right">
                        <xsl:value-of select="discount"/>
                        </fo:block>
                    </fo:table-cell>
                    <fo:table-cell border="1pt double black" display-align="center" hyphenate="true" language="en">
                        <fo:block font-weight="bold" text-align="right">
                        <xsl:value-of select="discountAmount"/>
                        </fo:block>
                    </fo:table-cell>
                </fo:table-row>
            </xsl:for-each>
            <fo:table-row height="0.4cm" background-color="#FFFFFF">
                <fo:table-cell number-columns-spanned="12" border="1pt double black" display-align="center" >
                    <fo:block font-weight="bold" text-align="right">Total</fo:block>
                </fo:table-cell>
                <fo:table-cell border="1pt double black" display-align="center" hyphenate="true">
                    <fo:block font-weight="bold" text-align="right"><xsl:value-of select="/creditNoteAcknowledgement/totalAdjustmentAmount"/></fo:block>
                </fo:table-cell>
            </fo:table-row>
        </fo:table-body>
	</fo:table>
	</fo:block>
</xsl:template>

<xsl:template match="notes">
   <xsl:if test="termsLabel!=''">
    <fo:table margin="2mm" width="100%" table-layout="fixed" background-color="#DEE1E2">
		<fo:table-column />
		    <fo:table-body>
			<fo:table-row height="0.4cm">
				<fo:table-cell font-weight="bold" display-align="center">
					<fo:block ><xsl:value-of select="termsLabel"/>
                    </fo:block>
				</fo:table-cell>
			</fo:table-row>
		</fo:table-body>
	</fo:table>
   </xsl:if>
</xsl:template>

</xsl:stylesheet>

